
-- $Id: InsertFrame.lua 71 2009-04-06 04:43:41Z Fylgjas $

-- ========================================================================= --
-- Copyright © 2009 Thomas ROBERT (aka Fylgjas EU - Marécage de Zangar)      --
-- ========================================================================= --
-- This file is part of FyLooter.                                            --
--                                                                           --
-- FyLooter is free software: you can redistribute it and/or modify it under --
-- the terms of the GNU General Public License as published by the Free      --
-- Software Foundation, either version 3 of the License, or (at your option) --
-- any later version.                                                        --
--                                                                           --
-- FyLooter is distributed in the hope that it will be useful, but WITHOUT   --
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     --
-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for  --
-- more details.                                                             --
--                                                                           --
-- You should have received a copy of the GNU General Public License along   --
-- with FyLooter. If not, see <http://www.gnu.org/licenses/>.                --
-- ========================================================================= --

local revision = tonumber(string.sub("$Rev: 71 $", 7, -3));

if (FyLooter.revision < revision) then
  FyLooter.revision = revision;
end

-- ========================================================================= --



-- ========================================================================= --

-- 
-- FyLooter:CreateInsertFrame()
--
function FyLooter:CreateInsertFrame(parent)
  -- InsertFrame
  local InsertFrame = CreateFrame("Frame", nil, parent);
  InsertFrame:Hide();
  InsertFrame:SetHeight(58);
  InsertFrame:SetBackdrop(FyLooter.db.settings.backdrop);

  -- InsertFrame.PlayerEditBox
  InsertFrame.PlayerEditBox = CreateFrame("EditBox", nil, InsertFrame);
  InsertFrame.PlayerEditBox:SetHeight(22);
  InsertFrame.PlayerEditBox:SetPoint("TOPLEFT", 85, -7);
  InsertFrame.PlayerEditBox:SetPoint("TOPRIGHT", -7, -7);
  InsertFrame.PlayerEditBox:SetTextInsets(7, 7, 0, 0);
  InsertFrame.PlayerEditBox:SetBackdrop(FyLooter.db.settings.backdrop);
  InsertFrame.PlayerEditBox:SetFontObject(ChatFontNormal);

  local f = InsertFrame.PlayerEditBox:CreateFontString(nil, "ARTWORK", "GameFontNormal");
  f:SetHeight(22);
  f:SetWidth(78);
  f:SetPoint("RIGHT", InsertFrame.PlayerEditBox, "LEFT", -7, 0);
  f:SetJustifyH("RIGHT");
  f:SetText("Player:");

  -- InsertFrame.CharacterEditBox
  InsertFrame.CharacterEditBox = CreateFrame("EditBox", nil, InsertFrame);
  InsertFrame.CharacterEditBox:SetHeight(22);
  InsertFrame.CharacterEditBox:SetPoint("BOTTOMLEFT", 85, 7);
  InsertFrame.CharacterEditBox:SetPoint("BOTTOMRIGHT", -7, 7);
  InsertFrame.CharacterEditBox:SetTextInsets(7, 7, 0, 0);
  InsertFrame.CharacterEditBox:SetBackdrop(FyLooter.db.settings.backdrop);
  InsertFrame.CharacterEditBox:SetFontObject(ChatFontNormal);
  InsertFrame.CharacterEditBox:SetScript("OnShow", function(self) self:SetFocus() end);

  local f = InsertFrame.CharacterEditBox:CreateFontString(nil, "ARTWORK", "GameFontNormal");
  f:SetHeight(22);
  f:SetWidth(78);
  f:SetPoint("RIGHT", InsertFrame.CharacterEditBox, "LEFT", -7, 0);
  f:SetJustifyH("RIGHT");
  f:SetText("Character:");
  
  return InsertFrame;
end

-- ========================================================================= --

